/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/appr-contract/hetongzbnd/page',
    method: 'get',
    params: query
  })
}

export function fetchListChild(query) {
  return request({
    url: '/appr-contract/hetongwfhandle/page',
    method: 'get',
    params: query
  })
}

export function getObj(id) {
  return request({
    url: '/appr-contract/hetonghtcj/' + id,
    method: 'get'
  })
}

export function submitStatus(id) {
    return request({
      url: '/appr-contract/hetongzbnd/'+id,
      method: 'get'
    })
}
export function endTask(query) {
  return request({
    url: '/appr-contract/hetongzbnd/endTask',
    method: 'post',
    data: query
  })
}


export function submitStatusAll(query) {
    return request({
      url: '/appr-contract/hetongzbnd/submitStatusAll',
      method: 'post',
      data: query
    })
}
export function submitStatusAllPro(query) {
  return request({
    url: '/appr-contract/hetongzbnd/submitStatusAllPro',
    method: 'post',
    data: query
  })
}
//
export function getDeptId(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getDeptId',
    method: 'get',
    data: query
  })
}
// 发约人组织结构
export function fetchUserList(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getUserList',
    method: 'get',
    params: query
  })
}
// 发约人组织结构
export function fayuetree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/fayuetree',
    method: 'get',
    params: query
  })
}

// 所有树
export function alltree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/alltree',
    method: 'get',
    params: query
  })
}

// 受约人组织结构
export function shouyuetree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/shouyuetree',
    method: 'get',
    params: query
  })
}
// fayuetree1
export function fayuetree1(query) {
  return request({
    url: '/appr-contract/hetonghtcj/fayuetree1',
    method: 'get',
    params: query
  })
}
// 获取指标拟定部分
export function getNiDingList(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getNiDingList',
    method: 'get',
    params: query
  })
}
// 合同保存
export function saveHtong(obj) {
  return request({
    url: '/appr-contract/hetonghtcj/saveHtong',
    method: 'post',
    data: obj
  })
}

// 合同信息返回值
export function page(query) {
  return request({
    url: '/appr-contract/hetonghtcj/page',
    method: 'get',
    params: query
  })
}


export function getShow(query) {
  return request({
    url: '/appr-contract/hetonghtzbnd/getShow',
    method: 'post',
    data: query
  })
}

// 合同推送拟定
export function Htongndts(query) {
  return request({
    url: '/appr-contract/hetonghtcj/hetongndts',
    method: 'post',
    data: query
  })
}
// 推送文本审核
export function tuisongwenben(data) {
  return request({
    url: '/appr-contract/hetonghtcj/tuisongwenben',
    method: 'post',
    data: data
    })
}

// 发起签订前
export function faqiqiandingAfter(id) {
  return request({
    url: '/appr-contract/hetongwfhandle/isArriveEight',
    method: 'get'
  })
}

// 发起签订前
export function faqiqiandingtongguo(query) {
  return request({
    url: '/appr-contracthetongwfhandle/faqiqiandingtongguo',
    method: 'post',
    params: query
  })
}

// 发起签订
export function faqiqianding(data) {
  return request({
    url: '/appr-contract/hetonghtcj/faqiqianding',
    method: 'post',
    data:data
  })
}

// 批量删除
export function deleteBatchHtcj(query) {
  return request({
    url: '/appr-contract/hetonghtcj/deleteBatch',
    method: 'get',
    params: query
  })
}
//批量审核
export function updateplshByid(query) {
  return request({
    url: '/appr-contract/hetonghtcj/updateplshByid',
    method: 'post',
    data: query
  })
}
export function updateFaYueState(query) {
  return request({
    url: '/appr-contract/hetonghtcj/updateFaYueState',
    method: 'post',
    data: query
  })
}

export function gethtlist(id) {
  return request({
    url: '/appr-contract/hetonghtcj/'+id,
    method: 'get'
  })
}
export function setwbsh(id,wbsh) {
  return request({
    url: '/appr-contract/hetonghtcj/wenbenshenhe/'+id+'/'+wbsh,
    method: 'get'
  })
}
//文本审核-批量同意或驳回
export function setwbshStatus(data) {
  return request({
    url: '/appr-contract/hetonghtcj/setwbshStatus',
    method: 'post',
    data:data
  })
}

//合同审核-批量同意或驳回
export function sethtshStatus(data) {
  return request({
    url: '/appr-contract/hetonghtcj/sethtshStatus',
    method: 'post',
    data:data
  })
}
export function selecthtgzById(id) {
  return request({
    url: '/appr-contract/hetonghtcj/selecthtgzById/'+id,
    method: 'get'
  })
}

export function getSumWeight(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getSumWeight',
    method: 'get',
    params: query
  })
}
export function pageSh(query) {
  return request({
    url: '/appr-contract/hetongzbnd/page',
    method: 'get',
    params: query
  })
}

export function saveZBData(query) {
  return request({
    url: '/appr-contract/hetongzbnd/saveZBData',
    method: 'post',
    data: query
  })
}

export function saveZBCData(query) {
  return request({
    url: '/appr-contract/workFlowHtzb/saveZBData',
    method: 'post',
    data: query
  })
}

export function okAllApish(query) {
  return request({
    url: '/appr-contract/hetonghtzb/okAllApish',
    method: 'post',
    data: query
  })
}

export function backAllApish(query) {
  return request({
    url: '/appr-contract/hetonghtzb/backAllApish',
    method: 'post',
    data: query
  })
}

export function chakanExportExcel(query)
{
  return request({
    url: '/appr-contract/hetonghtcj/chakanExportExcel',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}
//复用指标
export function copyZhiBiaoh(query) {
  return request({
    url: '/appr-contract/hetonghtzb/copyZhiBiao',
    method: 'get',
    params: query
  })
}

//将该指标数据推送到其他合同下
export function tsHengTong(query) {
  return request({
    url: '/appr-contract/hetonghtzb/tsHengTong',
    method: 'get',
    params: query
  })
}

// 复用指标、推送合同显示数据
export function getPageForfy(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getPageForfy',
    method: 'get',
    params: query
  })
}
export function getPageForfyzbnd(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getPageForfyzbnd',
    method: 'get',
    params: query
  })
}
//指标拟定推送到其他合同显示
export function getPageFortszbnd(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getPageFortszbnd',
    method: 'get',
    params: query
  })
}
//指标审核-判断该合同下是否有指标驳回
export function confirmStatus(ids) {
  return request({
    url: '/appr-contract/hetonghtzb/confirmStatus/'+ids,
    method: 'get'
  })
}
//指标审核-判断该合同下是否有指标驳回
export function confirmStatusforzbsh(ids) {
  return request({
    url: '/appr-contract/hetonghtzb/confirmStatusforzbsh/'+ids,
    method: 'get'
  })
}

//文本审核获取合同数据
export function pageForWb(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getPageForWb',
    method: 'get',
    params: query
  })
}

//文本审核-判断该合同下是否有指标驳回
export function confirmForWb(ids) {
  return request({
    url: '/appr-contract/hetonghtzb/confirmForWb/'+ids,
    method: 'get'
  })
}
//查询合同权重值%
export function getHtWeight(data) {
  return request({
    url: '/appr-contract/hetonghtcj/getHtWeight',
    method: 'post',
    data: data
  })
}
//合同查看
export function selectpages(data) {
  return request({
    url: '/appr-contract/htchakan/selectpages',
    method: 'get',
    params: data
  })
}

// 批量删除
export function faqiguidang(query) {
  return request({
    url: '/appr-contract/hetonghtcj/faqiguidang',
    method: 'get',
    params: query
  })
}

//指标拟定提交-判断是否有指标目标值为空
export function confirmMubiao(data) {
  return request({
    url: '/appr-contract/hetonghtzb/confirmMubiao',
    method: 'post',
    data: data
  })
}
export function isflagzhibiao(data) {
  return request({
    url: '/appr-contract/hetonghtzb/isflagzhibiao',
    method: 'post',
    data: data
  })
}

export function exportExcel(){
  return request({
    url: '/appr-contract/hetonghtcj/downloadTemplate',
    method: 'post',
    responseType: 'blob'
  })
}
//获取模板下拉
export function getContractTypeDict(query){
  return request({
    url: '/appr-contract/hetongacttemplate/getContractTypeDict',
    method: 'get',
    params: query
  })
}
// 保存校验
export function isExsitContractType(data) {
  return request({
    url: '/appr-contract/hetongacttemplate/isExsitContractType',
    method: 'post',
    data: data
  })
}
// isExsitTemplateName
export function isExsitTemplateNamejy(data) {
  return request({
    url: '/appr-contract/hetongacttemplate/isExsitTemplateName',
    method: 'post',
    data: data
  })
}
export function copyTemplateMainAndDetail(data) {
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/copyTemplateMainAndDetail',
    method: 'get',
    params: data
  })
}

// 自定义流程提交
export function submitStatusAllfn(query){
  return request({
    url: '/appr-contract/hetongzbnd/submitStatusAll',
    method: 'post',
    data: query
  })
}
// 校验模板
export function isExsitContractTypeForNd(query){
  return request({
    url: '/appr-contract/hetongacttemplate/isExsitContractTypeForNd',
    method: 'post',
    data: query
  })
}
// 模板保存
export function saveTemplate(query){
  return request({
    url: '/appr-contract/hetongacttemplate/saveTemplate',
    method: 'post',
    data: query
  })
}
//模板分页
export function getemPage(query){
  return request({
    url: '/appr-contract/hetongacttemplate/page',
    method: 'get',
    params: query
  })
}
//模板删除
export function deleteBatch(query){
  return request({
    url: '/appr-contract/hetongacttemplate/deleteBatch',
    method: 'get',
    params: query
  })
}
// 获取模板名称列表 hetongcjacttemplatemain/page
export function tempage(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/page',
    method: 'get',
    params: query
  })
}
// 新增模板校验
export function isExsitTemplateName(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/isExsitTemplateName',
    method: 'get',
    params: query
  })
}
// 新增模板
export function saveTemplateName(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/saveTemplate',
    method: 'post',
    data: query
  })
}
// 获取合同创建中的模板列表
export function getTempList(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatedetail/getTempList',
    method: 'get',
    params: query
  })
}
// 获取合同模板详情
export function getTempListForZdrw(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatedetail/getTempListForZdrw',
    method: 'get',
    params: query
  })
}
// 获取任务书模板详情
export function getTempListForgzrws(query){
  return request({
    url: '/appr-contract/hetongcjacttemplatedetail/getTempListForGzrws',
    method: 'get',
    params: query
  })
}
// 失去焦点保存
export function saveTemplatehang(data) {
  return request({
    url: '/appr-contract/hetongcjacttemplatedetail/saveTemplate',
    method: 'post',
    data: data
  })
}
// 提交模板有效性
export function effective(data) {
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/getEffectiveTemplate',
    method: 'get',
    params: data
  })
}
// hetongcjacttemplatedetail/getStepInfo
export function getStepInfo(data) {
  return request({
    url: '/appr-contract/hetongcjacttemplatedetail/getStepInfo',
    method: 'get',
    params: data
  })
}
// 模板shanchu
export function deleteBatchtem(data) {
  return request({
    url: '/appr-contract/hetongcjacttemplatemain/deleteBatch',
    method: 'get',
    params: data
  })
}
// 指标拟定-->推送到其他合同
export function pageByTs(query) {
  return request({
    url: '/appr-contract/hetongzbnd/pageByTs',
    method: 'get',
    params: query
  })
}
// 指标拟定-->指标 推送到其他合同
export function tsZhibiaoToNiDing(query) {
  return request({
    url: '/appr-contract/hetongzbnd/tsZhibiaoToNiDing',
    method: 'post',
    data: query
  })
}

export function tsZhibiaoToHetong(query) {
  return request({
    url: '/appr-contract/hetonghtcj/tsZhibiaoToHetong',
    method: 'post',
    data: query
  })
}
